package co.yixiang.retail.common.hystrix;


import co.yixiang.common.core.api.ApiResult;
import co.yixiang.mall.common.mall.domain.YxSystemStore;
import co.yixiang.mall.common.mall.param.HLoginParam;
import co.yixiang.retail.common.domain.UserInfo;
import co.yixiang.retail.common.feign.RemoteStoreUserService;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteStoreUserFallbackFactory implements FallbackFactory<RemoteStoreUserService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteStoreUserFallbackFactory.class);
    @Override
    public RemoteStoreUserService create(Throwable throwable) {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return  new RemoteStoreUserService(){
            @Override
            public ApiResult<UserInfo> getRetailByPhone(String phone) {
                return null;
            }
        };
    }
}
